package CSnab::Decorator::LinkUrl;

use strict;
use warnings;

use base qw(CSnab::Decorator);

sub link_url {
	return '#';
}

sub link_razdel {
	my $self = shift;
	my %params = (id => '', @_);
	
	return '#'
		unless $params{id};
	
	return '/razdel-' . $params{id} . '.html';
}

sub filter {
	my ($self, $content) = @_;

	my $field  = 'link_url';
	my $method = 'link_razdel';

	
	if (ref $self){
		$field  = $self->{field}  if $self->{field};
		$method = $self->{method} if $self->{method};
	}#end if
	
	$content->{$field} = $self->$method(%$content);
}

1;
